CONST addr = &H104 'set base address here OUT addr + 1, &HFF 'reset CTM05 OUT addr + 1, &HD1 'disarm counter 1 OUT addr + 1, &H17 'select master mode register OUT addr, &H0 'write low byte of master mode register OUT addr, &HD0 'write high byte of master mode register OUT addr + 1, &H1 'select counter 1 mode register OUT addr, &H42 'write lowbyte of counter 1 mode G OUT addr, &HB 'write high byte of counter 1 mode G OUT addr + 1, &H9 'select load register of counter 1 OUT addr, &HFF 'load low byte of load register OUT addr, &HFF 'load high byte of load register OUT addr + 1, &H11 'select hold register of counter 1 OUT addr, &HFF 'load low byte of hold register OUT addr, &HFF 'load high byte of hold register OUT addr + 1, &H21 'arm counter 1